package com.liangzdemo.SerialPort;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.liangzdemo.R;

public class Main5Activity extends AppCompatActivity implements View.OnClickListener{

    private Button mybtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main5);

        mybtn = (Button) findViewById(R.id.button6);
        mybtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {

        StringBuffer buf=new StringBuffer();
        byte[] sendcm = {0x44, 0x4D, 0x47, 0x0D};
        String d=new String(sendcm,0,4);
        SerialPortUtil.sendSerialPort(d);
    }
}
